import QtQuick 1.0

Item {
    id: gameView
    objectName: "gameview"

    // *** Background image ***
    Image {
        id: backgroundImage
        source: "images/bg/bg_game.jpg"
        x: 0
        y: 0
        z: 0
    }

    Plate{
        //id: plate
        objectName: "myplate"
    }

    Item {
        objectName: "arrayCake"

    }

    Image {
        id: oven
        source: "images/as/as_atasgame.png"
        x: 0
        y: 0
//        z: 98
    }

    Button {
        id: pauseButton
        imagesource: "images/bu/bu_pause.png"
        width: 67
        height: 52
        x: 285
        y: 10
        onClicked: {
            gameWindow.setPause(true);
            console.log("pause")
        }
    }

    OrderList{
        x: 0
        y: 0
    }

    Text {
        objectName: "score"
        id:myScore
        text: "0"
        x: 50
        y: 605
    }

    Image {
        id: life1
        source: "images/as/as_life.png"
        opacity: 1
        x:320
        y:605
    }
    Image {
        id: life2
        source: "images/as/as_life.png"
        opacity: 1
        x:270
        y:605
    }
    Image {
        id: life3
        source: "images/as/as_life.png"
        opacity: 1
        x:220
        y:605
    }
    Image {
        id: life4
        source: "images/as/as_life.png"
        opacity: 1
        x:170
        y:605
    }

    Text {
        objectName: "life"
        id: text
        text: "4"
        opacity: 0;
        onTextChanged: {
            if(text.match("4")){
                    life1.opacity=1;
                    life2.opacity=1;
                    life3.opacity=1;
                    life4.opacity=1;
                } else if(text.match("3")){
                    life1.opacity=1;
                    life2.opacity=1;
                    life3.opacity=1;
                    life4.opacity=0;
                } else if(text.match("2")){
                    life1.opacity=1;
                    life2.opacity=1;
                    life3.opacity=0;
                    life4.opacity=0;
                } else if(text.match("1")){
                    life1.opacity=1;
                    life2.opacity=0;
                    life3.opacity=0;
                    life4.opacity=0;
            } else if(text.match("0")){
                    life1.opacity=0;
                    life2.opacity=0;
                    life3.opacity=0;
                    life4.opacity=0;
                mainWidget.setScore((parseInt(myScore.text))+1-1);
                mainWidget.setScreen(5);
                }

            }
    }


}
